package com.mmy.util;

import javax.servlet.http.HttpSession;

import com.mmy.domain.sys.TSysUser;

/**
 * @vesion 
 * @description 
 * @author liys
 * @date 2021-6-1
 */
public class CodeUtil {
	
	/**
	  * @descr 参数为空返回 0;有值转成int返回
	  * @param 
	  * @return 
	  * @throws 
	  * @author liys
	  * @date 2021-7-21
	 */
	public static int MaxID(Object objCode) {
		
		int iID = 0;
		if (objCode != null) {
			iID = Integer.parseInt(objCode.toString());
		}
		return iID;
	}
	
	/**
	  * @descr 从session获取公司id
	  * @param 
	  * @return 
	  * @throws 
	  * @author liys
	  * @date 2021-7-21
	 */
	public static int getOrgID(HttpSession session) {
		
		TSysUser user = (TSysUser) session.getAttribute("tSysUser");
		int id = user.getOrgID();
		return id;
	}
	
	
}
